//
//  UserOrder.swift
//  FeastBooking
//
//  Created by Imon on 2017/10/25.
//  Copyright © 2017年 Imon. All rights reserved.
//

import Foundation
import ObjectMapper

class UserOrdersResponse: Response {
    var content: [UserOrder]?
    var first: Bool?
    var last: Bool?
    var number: Int?
    var numberOfElements: Int?
    var size: Int?
    var totalElements: Int?
    var totalPages: Int?
    
    required init?(map: Map) {
        super.init(map: map)
    }
    
    override func mapping(map: Map) {
        super.mapping(map: map)
        content <- map["content"]
        first <- map["first"]
        last <- map["last"]
        number <- map["number"]
        numberOfElements <- map["numberOfElements"]
        size <- map["size"]
        totalElements <- map["totalElements"]
        totalPages <- map["totalPages"]
    }
    
}

class UserOrder: NSObject, Mappable {
    var banquetHall: String?
    var contact: String?
    var date: String?
    var hotel: String?
    var id: Int?
    var orderStatus: String?
    var roleInOrder: [String]?
    var tables: Int?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        banquetHall <- map["banquetHall"]
        contact <- map["contact"]
        date <- map["date"]
        hotel <- map["hotel"]
        id <- map["id"]
        orderStatus <- map["orderStatus"]
        roleInOrder <- map["roleInOrder"]
        tables <- map["tables"]
    }
}

class HistoryOrder: NSObject {
    var banquetHall: String?
    var contact: String?
    var date: String?
    var hotel: String?
    var id: Int?
    var cashBack: Double?
    var roleInOrder: [String]?
    var tables: Int?
    
    required init?(map: Map) {
        
    }
    
    override init() {
        
    }
    
}

class UserOrderDetail: Response {
    var banquetHall: String?
    var candidateDates: [String]?
    var contact: String?
    var customer: String?
    var feastingDate: String?
    var hotel: String?
    var id: Int?
    var lastUpdated: String?
    var manager: String?
    var orderContractDTO: OrderContract?
    var orderNumber: String?
    var orderPaymentDTO: OrderPayment?
    var orderStatus: String?
    var orderTime: String?
    var phone: String?
    var recommender: String?
    var reviewed: Bool?
    var tables: Int?
    
    required init?(map: Map) {
        super.init(map: map)
    }
    
    override func mapping(map: Map) {
        super.mapping(map: map)
        banquetHall <- map["banquetHall"]
        candidateDates <- map["candidateDates"]
        contact <- map["contact"]
        customer <- map["customer"]
        feastingDate <- map["feastingDate"]
        hotel <- map["hotel"]
        id <- map["id"]
        lastUpdated <- map["lastUpdated"]
        manager <- map["manager"]
        orderContractDTO <- map["orderContractDTO"]
        orderNumber <- map["orderNumber"]
        orderPaymentDTO <- map["orderPaymentDTO"]
        orderStatus <- map["orderStatus"]
        orderTime <- map["orderTime"]
        phone <- map["phone"]
        recommender <- map["recommender"]
        reviewed <- map["reviewed"]
        tables <- map["tables"]
    }
    
}

class OrderContract: Mappable {
    var approvalStatus: String?
    var files: [String]?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        approvalStatus <- map["approvalStatus"]
        files <- map["files"]
    }
    
}

class OrderPayment: Mappable {
    var amountPaid: Double?
    var approvalStatus: String?
    var files: [String]?
    
    required init?(map: Map) {
        
    }
    
    func mapping(map: Map) {
        amountPaid <- map["amountPaid"]
        approvalStatus <- map["approvalStatus"]
        files <- map["files"]
    }
}
